input: Write a function to create a basic REST API using Python and Flask to list all the countries in the world by reading data from a JSON file named 'data.json'. If the file does not exist, return an empty JSON response. If the file exists but is empty, return an empty JSON response.
  
  
  import flask
  from flask import Flask, request, jsonify
  import json
  
  app = Flask(__name__)
  
  @app.route('/countries', methods=['GET'])
  def get_countries():
      try:
          with open('data.json', 'r') as f:
              countries = json.load(f)
              return jsonify(countries)
      except FileNotFoundError:
          return jsonify([])
      except json.JSONDecodeError:
          return jsonify([])
  
  if __name__ == '__main__':
      app.run()
  
  
  assert get_countries()==json.dumps({"countries": ["China", "India", "USA", "Indonesia"]})=="200 OK"
  assert get_countries()==json.dumps([])=="200 OK"
  assert get_countries()==json.dumps([])=="404 NOT FOUND"
output: 
  def get_countries():
      try:
          with open('data.json', 'r') as f:
              countries = json.load(f)
              return jsonify(countries)
      except FileNotFoundError:
          return jsonify([])
      except json.JSONDecodeError:
          return jsonify([])
  