small improvements

* move more stuff into library
* implements all the GET api
* make tests pass again
implement post API
wip: implement rf-add
converter: fix SQL error when creating very large bases