def handle_args(args):
  """

  :param args: The dictionary form of request.args.
  :return: The values removed from lists if they are in a list. This is flask weirdness.
      Sometimes x=y gets represented as {'x': ['y']} and this converts to {'x': 'y'}
  """
  result = {}

  if args is not None:
    for k, v in args.items():
      if type(v) == list:
        v = v[0]
      result[k] = v

  return result