update server.js to be more generic