edited table_to_json