input: Write a function to create an API using Flask and Python which takes a list or array of integers and returns their minimum and maximum values. The function should be accessed via a POST request to the '/minmax' endpoint.
  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([12, 4, 9, 24, -5])=={'min': -5, 'max': 24}
  assert minmax([3, 5, 1, 2, 4])=={'min': 1, 'max': 5}
  assert minmax([10, 20, 30, 40, 50])=={'min': 10, 'max': 50}
  assert minmax([-3, -2, -1, 0, 1, 2, 3])=={'min': -3, 'max': 3}
  assert minmax([])=={'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}
  