There are a lot of "if valid then...else error-404" sections in this code. Why not just return nil, and have the last entry in `routes` produce a 404 page?