Storage API: fixes and introduction of hook functions