Updated server.js to provide hooks for nodefly