update geolocation plugin
extract common apis into its own file