Task/expose backend api

Refactored error messages to be more consistent
Added error catching to every query
Added more route functions