input: Write a function to create a basic REST API using Python and Flask to list all the countries in the world. The function should define a route '/countries' that returns a JSON list of countries when accessed via a GET request.
  assert get_countries_api() == "import flask\nfrom flask import Flask, request, jsonify\nimport json\n\napp = Flask(__name__)\n\n@app.route('/countries', methods=['GET'])\ndef get_countries():\n    with open('data.json', 'r') as f:\n        countries = json.load(f)\n    return jsonify(countries)\n\nif __name__ == '__main__':\n    app.run()"
  assert get_countries_api() == "@app.route('/countries', methods=['GET'])\ndef get_countries():\n    with open('data.json', 'r') as f:\n        countries = json.load(f)\n    return jsonify(countries)"
  assert get_countries_api() == "def get_countries():\n    with open('data.json', 'r') as f:\n        countries = json.load(f)\n    return jsonify(countries)"
  assert get_countries_api() == "with open('data.json', 'r') as f:\n    countries = json.load(f)\nreturn jsonify(countries)"
  assert get_countries_api() == "return jsonify(countries)"
  assert get_countries_api() == "countries = json.load(f)\nreturn jsonify(countries)"
  assert get_countries_api() == "with open('data.json', 'r') as f:\n    countries = json.load(f)"
output: 
  @app.route('/countries', methods=['GET'])
  def get_countries():
      with open('data.json', 'r') as f:
          countries = json.load(f)
      return jsonify(countries)
  