Moved some code from the controller into a RoutesHelper file and added methods urisMatches and findMatchingRouteEntry