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

      depth = 0
      page = 1

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

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

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