add debug flag to return request and response