input: Write a function to create a basic REST API using Python and Flask to list all the countries in the world. The API should have a route '/countries' that, when accessed via GET method, returns a JSON response containing all the countries loaded from a file named 'data.json'.
  import flask
  from flask import Flask, request, jsonify
  import json
  
  app = Flask(name)
  
  @app.route('/countries', methods=['GET'])
  def get_countries():
  with open('data.json', 'r') as f:
   countries = json.load(f)
   return jsonify(countries)
  
  if name == 'main':
   app.run()
  
  assert get_countries({'China', 'India', 'USA', 'Brazil'})=={"China": "Beijing", "India": "New Delhi", "USA": "Washington, D.C.", "Brazil": "Brasília"}
  assert get_countries({'Russia', 'Germany', 'France', 'Japan'})=={"Russia": "Moscow", "Germany": "Berlin", "France": "Paris", "Japan": "Tokyo"}
  assert get_countries({'Australia', 'Canada', 'Mexico', 'South Africa'})=={"Australia": "Canberra", "Canada": "Ottawa", "Mexico": "Mexico City", "South Africa": "Pretoria"}
  assert get_countries({})=={}
  assert get_countries([])==[]
output: 
  def get_countries():
      with open('data.json', 'r') as f:
          countries = json.load(f)
      return jsonify(countries)
  