Fleshed out logic for most of the route pattern matching