Sort API calls when possible