Replace Local Storage for api.id

This is a refactor for the api.id function that uses IDB instead of localstorage.