Implement back end of json export