completely functional JSON parsing