Minor bugs, added csv option for json use case