       sortKey: "surname"
       pageSize: 20
 
-  class Country extends Backbone.Model
-    urlRoot: "/country"
+    parse: (response) -> 
+      @state.totalRecords = response.total
+      @state.lastPage = Math.ceil(response.total / @state.pageSize)
+      response.data
+    parseRecords: (response) ->
+      response.data
+    parseState: (response) ->
+      @state.totalRecords = response.total
+      @state.lastPage = Math.ceil(response.total / @state.pageSize)
 
   )
 


          
          # render the person partial 
          require [ "text!../templates/view_details.html.tpl" ], (template) ->
            $("#person-details").html _.template(template,
              person: person
            )

          
          # now we have a name, add this to the breadcrumb

    a = @serializeArray()
    $.each a, ->
      if o[@name] isnt `undefined`
        o[@name] = [o[@name]]  unless o[@name].push
        o[@name].push @value or ""
      else
        o[@name] = @value or ""
      return

    o

  $.ajaxPrefilter (options, originalOptions, jqXHR) ->
    options.url = "http://localhost/researchdb/html/liverpool/api" + options.url
    return

  Person = Backbone.Model.extend(urlRoot: "/people")
  People = Backbone.Collection.extend(
    url: "/people"
    model: Person
    parse: (response) ->
      response
  )
  Backbone.PageableCollection = PageableCollection
  PaginatedPeople = Backbone.PageableCollection.extend(
    model: Person
