input: Write a function to create a REST API using Flask that lists all the countries in the world when a '/countries' endpoint is accessed. The function should return a JSON array of countries read from a 'data.json' file.
  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)
  
      if __name__ == '__main__':
          app.run()
      return app
  
  assert create_countries_api() is not None
  assert create_countries_api().name == '__main__'
  assert create_countries_api().url_map.bind('').match('/countries').methods == {'GET'}
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)
  
      if __name__ == '__main__':
          app.run()
      return app