better api for idb