input: Write a function to create a basic REST API using Python and Flask that lists all the countries in the world. The function should define a Flask app with a route to retrieve the list of countries from a JSON file. The retrieved data should be returned in JSON format. If the call is successful, the API should return a 200 status code and the list of countries.
  
  import flask
  from flask import Flask, request, 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)
  
   if __name__ == '__main__':
    app.run()
  
  assert create_countries_api() is not None
  assert "countries" in create_countries_api().view_functions
  assert create_countries_api().view_functions['countries'].__name__ == 'get_countries'
  assert create_countries_api().response_class == flask.Response
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()
  