New API docs.

This is must be merged with master when the final version of the api is released.