input: Write a function to implement a basic blockchain system in Python that allows adding blocks and retrieving the entire blockchain in JSON format. The function should include a Block class for individual blocks and a Blockchain class to manage the chain of blocks. The test cases should verify the addition of blocks and the return of the blockchain in JSON format.
  
  assert blockchain_system().get_chain() == '[]'
  blockchain_system().add_block({'timestamp': '2023-10-01 12:00:00', 'data': 'First block'})
  assert blockchain_system().get_chain() == '[{"index": 0, "timestamp": "2023-10-01 12:00:00", "data": "First block", "previous_hash": null, "hash": "3fd7d529b3c88ffa5959b1205aee5a76c36da4ab5006cf37dd0fdb47afb78b74"}]'
  blockchain_system().add_block({'timestamp': '2023-10-02 12:00:00', 'data': 'Second block'})
  assert blockchain_system().get_chain() == '[{"index": 0, "timestamp": "2023-10-01 12:00:00", "data": "First block", "previous_hash": null, "hash": "3fd7d529b3c88ffa5959b1205aee5a76c36da4ab5006cf37dd0fdb47afb78b74"}, {"index": 1, "timestamp": "2023-10-02 12:00:00", "data": "Second block", "previous_hash": "3fd7d529b3c88ffa5959b1205aee5a76c36da4ab5006cf37dd0fdb47afb78b74", "hash": "another_hash_value"}]'
output: class Block:
      def __init__(self, index, timestamp, data, previous_hash):
          self.index = index
          self.timestamp = timestamp
          self.data = data
          self.previous_hash = previous_hash
          self.hash = self.calculate_hash()
  
      def calculate_hash(self):
          block_string = f"{self.index}{self.timestamp}{self.data}{self.previous_hash}"
          return hashlib.sha256(block_string.encode()).hexdigest()
  
  class Blockchain:
      def __init__(self):
          self.chain = []
          self.create_genesis_block()
  
      def create_genesis_block(self):
          self.chain.append(Block(0, "2023-10-01 12:00:00", "Genesis Block", "0"))
  
      def add_block(self, data):
          previous_block = self.chain[-1]
          new_index = previous_block.index + 1
          new_timestamp = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
          new_block = Block(new_index, new_timestamp, data, previous_block.hash)
          self.chain.append(new_block)
  
      def get_chain(self):
          return json.dumps([{'index': block.index, 'timestamp': block.timestamp, 'data': block.data, 'previous_hash': block.previous_hash, 'hash': block.hash} for block in self.chain])
  
  def blockchain_system():
      return Blockchain()