Improved api and added db

Added database wrapper with prepared queries and getResultsasobjects
method. Improved api to accept crud request methods and to return the
correct status code