Refactored API and web server. API resources are now seperated