Sneaky bastard, looking at what the game does in the background. hehe
Only after you posted that you wanted an API. :-)
But yeah, since I do similar stuff in BM:WI, it was obvious to check if you're doing it the same way. And yes, I'm also pumping out HTML instead of JSON and interpreting it in JS. It's easier to do it this way. :-)