JSON to API country state cities

How can we make json file with country, state and city names work as an api in flutter, so that aftef selecting country, corresponding states come and then corresponding cities ?