fixed json export, added csv export