Refactoring serverjs

removed console.logs, comments, dead functions