set reponse only after request
handle record not found errors as 404
handle routing errors as 404