docs: def default(value):
      """ Default encoder for JSON """
      if isinstance(value, Decimal):
          primative = float(value)
          if int(primative) == primative:
              return int(primative)
          else:
              return primative
      elif isinstance(value, set):
          return list(value)
      elif isinstance(value, Binary):
          return b64encode(value.value)
      raise TypeError("Cannot encode %s value %r" % (type(value), value))