update function to parse JSON directly, rather than rely on CSV api output. Currently doesn't correctly deduce data type