Work on api.rst
Turn into a package

The reason is basically just to be able to isolate legacy code into an own
module.
Be more stern about not using the legacy way