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 include a route 'minmax' that accepts POST requests with the array in JSON format and returns a JSON response with the min and max values.
  assert minmax([-3, 5, 2, -10, 9])=={'min': -10, 'max': 9}
  assert minmax([0, 0, 0, 0, 0])=={'min': 0, 'max': 0}
  assert minmax([100, -100])=={'min': -100, 'max': 100}
  assert minmax([1])=={'min': 1, 'max': 1}
  assert minmax([])=={'min': None, 'max': None}
output: 
  @app.route('/minmax', methods=['POST'])
  def minmax():
      data = request.get_json()
      if not data or not isinstance(data, list):
          return jsonify({'min': None, 'max': None})
      
      if not data:
          return jsonify({'min': None, 'max': None})
      
      min_val = min(data) if data else None
      max_val = max(data) if data else None
      
      return jsonify({'min': min_val, 'max': max_val})
  