creation of objectLoci() API function