input: Write a function that takes no input and returns a Flask REST API that lists all the countries from a JSON file named 'data.json'. The API should have a single endpoint accessible via a GET request at '/countries'. If the Flask app is run directly, it should start the server.
  
  from flask import Flask, jsonify
  import json
  
  def create_countries_api():
      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)
  
      return app
  
  assert create_countries_api().name == '__main__'
  assert create_countries_api().route('/countries').methods == ['GET']
  assert create_countries_api().run.__name__ == 'run'
  assert create_countries_api().get_countries.__name__ == 'get_countries'
output: def create_countries_api():
      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)
  
      return app