changed rescue method for api call restriction