validate returned json
simplified reading and writing json