Write getCountriesData function to minimize number of ajax requests later. Refactor populateAll function.