input: Write a function to create a basic REST API using Python and Flask to list all the countries in the world. Use the Flask framework to create a route that responds to GET requests and returns a JSON list of countries. The data should be loaded from a local JSON file named 'data.json'. If the API is run locally, it should start the server.
  assert create_rest_api() is not None  
  assert isinstance(create_rest_api(), flask.Flask)  
  assert create_rest_api().test_client().get('/countries').status_code == 200
output: def create_rest_api():
      from flask import Flask, jsonify
      import json
  
      app = Flask(__name__)
  
      @app.route('/countries', methods=['GET'])
      def get_countries():
          with open('data.json', 'r') as file:
              data = json.load(file)
          return jsonify(data)
  
      return app