Implement a common saving method to .json text files