Some tests for the API with some bugfixes.

You can create and use the API stuff now, as well as get documentation
back out of it. You don't get any API methods that aren't documented,
because if you don't want to write docs for it, how do you expect a
client to use it?!