removed uneeded deps
Refactored server into a module. Wired up main app.
Fix tests
E2E test for rest api as a whole.