code: def sanitize_ep(endpoint, plural=False):
          
          # if we need a plural endpoint (acessing lists)
          if plural:
              if endpoint.endswith('y'):
                  endpoint = endpoint[:-1] + 'ies'
              elif not endpoint.endswith('s'):
                  endpoint += 's'
          else:
              # otherwise make sure it's singular form
              if endpoint.endswith('ies'):
                  endpoint = endpoint[:-3] + 'y'
              elif endpoint.endswith('s'):
                  endpoint = endpoint[:-1]
  
          return endpoint
docs: Sanitize an endpoint to a singular or plural form.
  
          Used mostly for convenience in the `_parse` method to grab the raw
          data from queried datasets.
  
          XXX: this is el cheapo (no bastante bien)