Finalized the server interface for defining routes and listen for socket events