Reworked routes to handle all formats

This ensures that all requests get an appropriate reponse and no errors
are generated.