added logging of response codes