Refactor for api-storage (new lib)