logging api response when error