new function to export data as json