Add a redirect function to the response type