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 load the country data from a JSON file and return it as a JSON response when the '/countries' endpoint is accessed via a GET request.
  
  def create_country_api():
      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 create_country_api().__name__ == 'create_country_api'
  assert create_country_api().config['DEBUG'] == False
  assert create_country_api().__module__ == '__main__'
output: 
  def create_country_api():
      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()
  