Made json parsing object/array local to createDataset()