AJAX geolocation and basic API