check if owningLibrary exists before using apikey