Added optional recording of requests in debug mode.