Add basic document persistence api.