added event listeners to request and response