Api server (WIP)

Server ipmlementing the actual REST API.

This is still work in progress, but we should have multiple sets of eyes on this from the beginning.

@lokI8, please have a look at this periodically.