added a json reader and writer methods