Fixed behavior of api controller routes
- now it parses the query string and puts that into the actual values
- detects case where route is of the right form but the controller does not exist
Refactoring the api route matching code for clarity