capture response on JSON error