Added counting to the storage api