change generate to use json instead of csv