Refactors routes to use nested routing and config file