updated server and main js file