       depth = 0
       page = 1
 
-      # Traverse a book's tree and setup page, unit, parent, depth, and subcollection
+      # Traverse a book's tree and set book, depth, unit, parent, subcollection, and page
       # information on each node of the tree prior to the tree being processed
       # by backbone-associations.
       traverse = (o = {}) =>

      type: Backbone.Many
      key: 'authors'
      collectionType: Backbone.Collection
    }]

    toJSON: () ->
      currentPage = @get('currentPage')?.toJSON()
      toc = @get('toc').toJSON()
      json = super()
      json.currentPage = currentPage
      json.toc = toc
      return json

    parse: (response) ->
      type = response.type = MEDIA_TYPES[response.mediaType]


      traverse(response.tree)

      # Total number of pages in the book
      response.pages = page - 1

      return response
