check error code from api response. Fix for broken logout in the API