finished JSON parser, TODO encoder