added error type and error rendering in the route