share-api function and tests