input: Write a function to create an API using Flask that takes a list or array of integers and returns their minimum and maximum values. The function should define a route '/minmax' that accepts POST requests with a JSON payload containing the array of integers.
  
  from flask import Flask, request
  app = Flask(name)
  
  @app.route('/minmax', methods=['POST'])
  def minmax():
   data = request.get_json()
   nums = data['nums']
   minVal = min(nums)
   maxVal = max(nums)
   return {'min': minVal, 'max': maxVal}
  
  if name == 'main':
   app.run()
  
  assert minmax()({'nums': [12, 4, 9, 24, -5]})=={'min': -5, 'max': 24}
  assert minmax()({'nums': [0, 0, 0, 0]})=={'min': 0, 'max': 0}
  assert minmax()({'nums': []})=={'min': None, 'max': None}
output: 
  def minmax():
      data = request.get_json()
      nums = data['nums']
      if nums:
          minVal = min(nums)
          maxVal = max(nums)
      else:
          minVal = None
          maxVal = None
      return {'min': minVal, 'max': maxVal}
  