Added export functionality for csv and json