I think boiledfruit is right. I've yet to do MDMA myself, but I heard it's absolutely disgusting tasting. Also, heating most chemicals alter effects, sometimes making it useless.
I'd just pop it or rail it, myself. Eat the cake afterward, it'd probably taste way better anyhow.