           else
             statusCode: 404
             body: {status: "fail", message: "No items found"}
+
+
+  ###*
+    A set of endpoints that can be applied to a Meteor.users Collection Route
+  ###
+  _userCollectionEndpoints:
+    get: (collection) ->
+      get:
+        action: ->
+          entity = collection.findOne @urlParams.id, fields: profile: 1
+          if entity
+            {status: "success", data: entity}
+          else
+            statusCode: 404
+            body: {status: "fail", message: "User not found"}
+    put: (collection) ->
+      put:
+        action: ->
+          entityIsUpdated = collection.update @urlParams.id, $set: profile: @bodyParams
+          if entityIsUpdated
+            entity = collection.findOne @urlParams.id, fields: profile: 1
+            {status: "success", data: entity}
+          else
+            statusCode: 404
+            body: {status: "fail", message: "User not found"}
+    delete: (collection) ->
+      @_collectionEndpoints.delete collection
+    post: (collection) ->
+      post:
+        action: ->
+          # Create a new user account
+          entityId = Accounts.createUser @bodyParams
+          entity = collection.findOne entityId, fields: profile: 1
+          if entity
+            {status: "success", data: entity}
+          else
+            statusCode: 400
+            {status: "fail", message: "No user added"}
+    getAll: (collection) ->
+      get:
+        action: ->
+          entities = collection.find({}, fields: profile: 1).fetch()
+          if entities
+            {status: "success", data: entities}
+          else
+            statusCode: 404
+            body: {status: "fail", message: "Unable to retrieve users"}
+    deleteAll: (collection) ->
+      @_collectionEndpoints.deleteAll collection
 
 
   ###

      get:
        action: ->
          entities = collection.find().fetch()
          if not entities
            {status: "success", data: entities}
          else
            statusCode: 404

  ###*
    Generate routes for the Meteor Collection with the given name
  ###
  addCollection: (name, options) ->
    # Get the collection from the db
    if name.toLowerCase() is 'users'
      @_addCollection @_userCollectionEndpoints, Meteor.users, name, options
    else
      @_addCollection @_collectionEndpoints, new Mongo.Collection(name), name, options
    return


  ###*
    Generate routes for the Meteor Collection with the given name
  ###
  _addCollection: (collectionEndpoints, collection, name, options = {}) ->
    methods = ['get', 'post', 'put', 'delete', 'getAll', 'deleteAll']
    methodsOnCollection = ['post', 'getAll', 'deleteAll']

    # Flatten the options and set defaults if necessary
    configurableEndpoints = options.endpoints
    defaultOptions = options.default or {}
    blacklist = options.blacklist or []

    # Use collection name as default path
    path = options.path or name

    # Separate the requested endpoints by the route they belong to (one for operating on the entire collection and one
    # for operating on a single entity within the collection)
    collectionRouteEndpoints = {}
    entityRouteEndpoints = {}
    if not configurableEndpoints  # Generate all endpoints on this collection
      # Partition the endpoints into their respective routes
      _.each methods, (method) ->
        if method in methodsOnCollection
          _.extend collectionRouteEndpoints, collectionEndpoints[method].call(this, collection)
        else _.extend entityRouteEndpoints, collectionEndpoints[method].call(this, collection)
        return
      , this
    else
