Quick draft of the API server

wondering if it would be more readable with a `typedef void *db_handle`