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 return the Flask app instance. If the given file 'data.json' does not exist, the function should return an error message.
  assert create_rest_api() is not None
  assert create_rest_api().test_client().get('/countries').status_code == 200
output: def create_rest_api():
      from flask import Flask, jsonify
      import os
      import json
  
      app = Flask(__name__)
  
      if not os.path.exists('data.json'):
          return "Error: data.json file does not exist"
  
      with open('data.json', 'r') as file:
          countries = json.load(file)
  
      @app.route('/countries', methods=['GET'])
      def get_countries():
          return jsonify(countries)
  
      return app