huge refactor for routes to work