have controllers return error code and error response object instead of redirect