refactor routes to use resources