modified server/main.coffee, code cleaning, and fixed a bug