cleaned up nested callbacks in server.coffee