initial work on saveDocument function as a json string