Update routes to better suit future needs and fix some code for best practice