simple json parser and writer