added json read and write for files