Merged server code into codebase