Fix routes/index.js to remove prima-facie bugs

Fix the three bugs that have been found initially.