Refactored server and routes out of startup script