added some more logic for geofence transitions and fixed the check in
API call