input: Write a function to create a REST API with Python and Flask that allows users to perform CRUD operations on records in a database. The API should support creating, reading, updating, and deleting records. If the operation is successful, it should return the appropriate HTTP response code. If the operation fails, it should return an error message with the appropriate HTTP response code.
  
  
  assert get_records()=={'records':[]}
  assert create_record({'name': 'test'})=={'id': 1}
  assert get_records()=={'records':['test']}
  assert update_record(1, {'name': 'updated'})=={'message': 'Record updated'}
  assert get_records()=={'records':['updated']}
  assert delete_record(1)=={'message': 'Record deleted'}
  assert get_records()=={'records':[]}
  
output: 
  records = []
  
  def get_records():
      return {'records': records}
  
  def create_record(record):
      records.append(record['name'])
      return {'id': len(records)}
  
  def update_record(record_id, updated_record):
      if 1 <= record_id <= len(records):
          records[record_id - 1] = updated_record['name']
          return {'message': 'Record updated'}
      return {'message': 'Record not found'}, 404
  
  def delete_record(record_id):
      if 1 <= record_id <= len(records):
          records.pop(record_id - 1)
          return {'message': 'Record deleted'}
      return {'message': 'Record not found'}, 404
  