added logic for generating json from csv