final changes to server.js and database.js
merge fix