Implement API non-RESTful format, JSONP, CORS

Fixes #53.
If the comment is right, shouldn’t you be using `if … else if … else`?