partial implementation of pets middleware
component that searches for a user in the database
error handling that differentiates between a production environment and client environment