exit on API error