Changes to mains program and json parsing