Add debugging functions and code to get last request/response