api: restructure and create 'api' directory

Shift the REST server logic into an 'api' directory. In the future, we
will create an openmotion front end, so we want to clearly delineate the
parts that serve the API.

This was fairly annoying due to the juju charm's assumptions.