   # Get the stats for the challenge and display the count of remaining
   # tasks
   ###
-  $.getJSON "c/#{challenge}/stats", (data) ->
-    remaining = data.total - data.done
+  $.getJSON "/api/challenges/#{challenge}/stats", (data) ->
+    remaining = data.stats.total - data.stats.done
     $("#counter").text remaining
 
 updateChallenge = (challenge) ->
   ###
   # Use the current challenge metadata to fill in the web page
   ###
-  $.getJSON "/c/#{challenge}/meta", (data) ->
-    currentChallenge = data
+  $.getJSON "/api/challenges/#{challenge}/meta", (data) ->
+    currentChallenge = data.challenge
     $('#challengeDetails').text currentChallenge.name
     if data.tileurl? and data.tileurl != tileURL
       tileURL = data.tileurl
       tileAttrib = data.tileasttribution if data.tileattribution?
       changeMapLayer(tileURL, tileAttrib)
-    currentChallenge.help = markdown.makeHTML(data.help)
-    currentChallenge.doneDlg = makeDlg(data.doneDlg)
+    currentChallenge.help = markdown.makeHtml(currentChallenge.help)
+    currentChallenge.doneDlg = makeDlg(currentChallenge.doneDlg)
 
 
 enableKeyboardShortcuts = ->

  ###
  # Takes dialog box data and returns a dialog box for nextUp actions
  ###
  dlg = $('<div></div>').addclass("dlg")
  dlg.append(markdown.toHTML(dlgData.text))
  buttons = $('div').addclass("buttons")
  for item in dlgData.buttons
    button = $('div').addclass("button")
    button.attr {onclick: "#{item.action}"}
    button.content(item.label)
    buttons.append(button)

  # Gets another task from the current challenge, close to the
  # location (if supplied)
  ###
  near = "#{map.getCenter().lat},#{map.getCenter().lng}" if not near
  url = "/api/challenges/#{challenge}/task?near=#{near}"
  $.getJSON url, (data) ->
    currentTask = data
    currentTask.startTime = new Date().getTime()
    showTask(data)

changeMapLayer = (layerUrl, layerAttrib = tileAttrib) ->
