API sorting by location