Refactor api geoloc