error handling added for all routes