Fix formatting errors in api.py

I'm using **MediaWiki-events** to create a firehose, which publishes standardised JSON events, converted to strings, via a ØMQ PUB socket.

While testing the firehose script, I discovered two formatting errors in `api.py` that caused python3 to fall over. This PR addresses *only* those formatting issues.

I'm using Python 3.4.1.