Splitting off persistence.api.ts.