 
       traverse(response.tree)
 
+      # Total number of pages in the book
       response.pages = page - 1
 
       return response

      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]

          else
            item.unit = "#{index+1}"

          # Determine if the item is a subcollection or a page
          if item.contents
            item.subcollection = true
            delete item.id
