moving request and response access to functions