Intercept request and response