Optimising API calls.