reorient json to record format