input: Write a function to create a REST API using Python and Flask that allows users to perform CRUD operations (Create, Read, Update, Delete) on records in a database. If the API is successfully created, it should return a Flask app object.
  
  assert create_rest_api()==<Flask 'main'>
  assert get_records()=='records':['Record1', 'Record2']
  assert create_record(name='Record3')['id']==3
  assert update_record(id=3, name='Record3Updated')['message']=='Record updated'
  assert delete_record(id=3)['message']=='Record deleted'
output: from flask import Flask, jsonify, request
  
  def create_rest_api():
      app = Flask(__name__)
      records = ['Record1', 'Record2']
  
      @app.route('/records', methods=['GET'])
      def get_records():
          return jsonify({'records': records})
  
      @app.route('/records', methods=['POST'])
      def create_record():
          new_record = request.json.get('name')
          records.append(new_record)
          return jsonify({'id': len(records)})
  
      @app.route('/records/<int:id>', methods=['PUT'])
      def update_record(id):
          if id <= len(records):
              records[id-1] = request.json.get('name')
              return jsonify({'message': 'Record updated'})
          return jsonify({'message': 'Record not found'}), 404
  
      @app.route('/records/<int:id>', methods=['DELETE'])
      def delete_record(id):
          if id <= len(records):
              records.pop(id-1)
              return jsonify({'message': 'Record deleted'})
          return jsonify({'message': 'Record not found'}), 404
  
      return app