passed the request and response objects to the template function so that the template can return data more flexibly. Also, ensured that the response.generate method exited if the response was sent in the status method since it is pointless to execute any code after that point in the generate method.