Add test on thrown Exception if the API returns an error