changed the data layer to use persist and merge