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 initialize a Flask app, define a route to handle the GET request for fetching the list of countries, and return the list in JSON format. The countries data should be loaded from a local JSON file named 'data.json'.
  assert create_country_api().get_countries() == json.dumps({'countries': ['Afghanistan', 'Albania', 'Algeria', 'Andorra', 'Angola', 'Antigua and Barbuda', 'Argentina']})
output: def create_country_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({'countries': data['countries']})
  
      return app