   @param context should be the HTTP.methods handler function
 
 ###
-authenticatePlatform = (collection) ->
+_authenticatePlatform = (collection) ->
 
   sentToken = @.requestHeaders[Apollos.api.tokenName]
 


###

  createEndpoint

  @example creartes a standard API endpoint at the given URL for the given
    entity

    createEndpoint "api/v1/people/", "person"

  @param url [String] the endpoint for the API to operate at
  @param entityType [String] is the name of the Apollos type that this endpoint
    is associated with

###
createEndpoint = (collection, singular, nameForUrl, options) ->
  options or= {}
  url = "#{Apollos.api.base}/#{nameForUrl}/:id"


          Apollos.debug "Dropping request because of unknown platform"
          return

        if options.subDocName
          handler = Apollos[singular][options.subDocName].update
        else
          handler = Apollos[singular].update

        return _upsertResource.call @, data, handler, platform.name

      catch error
        @.setStatusCode _unexpectedError
