Updated geolocation functionality using JSON