add main_server.js and change some crazy codes