-Refactored some api routes
-Added some api functionality