Handle root path in server.js
Also add comments and fix naming.