docs: def run_script_api(module_name):
      '''API handler. Take script input (from script_input above), run the run()
      function, and return the results'''
      filename = ''
      file_stream = ''
      #form = {k : try_json(v) for k,v in request.values.items()}
      form = request.values.to_dict(flat=False)
      if request.json:
          form.update(request.json)
      for x in form:
          if type(form[x]) == list and len(form[x]) == 1:
              form[x] = form[x][0]
      for x in form:
          form[x] = try_json(form[x])
  
      if len(request.files) > 0:
          # Get the name of the uploaded file
          f = request.files['file_upload']
  
          # Make the filename safe, remove unsupported chars
          filename = secure_filename(f.filename)
          file_stream = f.stream
  
      form['HTTP_AUTHORIZATION'] = get_authorization()
      form['filename'] = filename
      form['file_stream'] = file_stream
      try:
          result = registered_modules[module_name].WebAPI().run(form)
      except:
          raise
          #return jsonify({'error' : str(traceback.format_exc())})
  
      if result['output_type'] == 'file':
          return Response(result['output'],
                          mimetype='application/octet-stream',
                          headers={'Content-Disposition':
                                   'attachment;filename='+result['filename']})
      else:
          return jsonify(result)