Added some basic db stuff (currently broken) and more to the api