updating the package.json and refactoring the server