Persist object as json text and json file