Add server code and comments