modify the server files and turn them into Node.js modules. Main thread part.