Run custom functions within the context of the response object