This change sorts the routes to get the most specific routes first and
avoid hitting a route which is not the most specific match.
With this the regex to extract variables is made more strict to avoid
matching half of the URI.
To make the router more loose, I replaced the router with the plain
environment. The custom parameters are stored in the same key, so can be
used by the request later.