Added test for API failure