input: Write a function that creates a basic REST API using Python and Flask to list all the countries in the world. The function should define an endpoint at `/countries` which returns a JSON list of countries loaded from a file named `data.json`. If the file is empty or not found, it should return an empty JSON list.
  assert get_countries() == {'countries': ['United States', 'Canada', 'Mexico', 'Brazil', 'Argentina']}
  assert get_countries() == {'countries': []}
output: 
  def get_countries():
      from flask import Flask, jsonify
      import json
  
      app = Flask(__name__)
  
      @app.route('/countries', methods=['GET'])
      def countries():
          try:
              with open('data.json', 'r') as file:
                  data = json.load(file)
                  return jsonify(countries=data.get('countries', []))
          except (FileNotFoundError, json.JSONDecodeError):
              return jsonify(countries=[])
  
      return app
  