Completed export to JSON functionality