Created PersistanceAgent to detect changes and save entities.