refactor routes and fix show action