input: Write a function to create an API using Flask and Python that takes a list or array of integers and returns their minimum and maximum values. The function should be defined as `minmax`, and it should be triggered by a POST request to the '/minmax' endpoint. The input is expected to be in JSON format with a key 'nums' holding the array of integers. If the input array is empty, the function should return a JSON object with 'min' and 'max' set to None. The following test cases should be asserted: 
  assert minmax([12, 4, 9, 24, -5])=={'min': -5, 'max': 24}
  assert minmax([0, 0, 0, 0])=={'min': 0, 'max': 0}
  assert minmax([])=={'min': None, 'max': None}
output: 
  from flask import Flask, request, jsonify
  
  app = Flask(__name__)
  
  @app.route('/minmax', methods=['POST'])
  def minmax():
      data = request.get_json()
      nums = data.get('nums', [])
      
      if not nums:
          return jsonify({'min': None, 'max': None})
      
      min_val = min(nums)
      max_val = max(nums)
      
      return jsonify({'min': min_val, 'max': max_val})
  