code: def add(obj):
      '''
      Handle a badge add API.
  
      - Expecting badge_fieds as payload
      - Return the badge as payload
      - Return 200 if the badge is already
      - Return 201 if the badge is added
      '''
      Form = badge_form(obj.__class__)
      form = api.validate(Form)
      kind = form.kind.data
      badge = obj.get_badge(kind)
      if badge:
          return badge
      else:
          return obj.add_badge(kind), 20f add(obj):
      '''
      Handle a badge add API.
  
      - Expecting badge_fieds as payload
      - Return the badge as payload
      - Return 200 if the badge is already
      - Return 201 if the badge is added
      '''
      Form = badge_form(obj.__class__)
      form = api.validate(Form)
      kind = form.kind.data
      badge = obj.get_badge(kind)
      if badge:
          return badge
      else:
          return obj.add_badge(kind), 201
docs: Handle a badge add API.
  
      - Expecting badge_fieds as payload
      - Return the badge as payload
      - Return 200 if the badge is already
      - Return 201 if the badge is added