refactor

* Add /api/ to path endpoints. API still in development so no major bump

* Move database connection to separate method (encapsulation)