csv to JSON conversion working (badly)