Added response handling code.