     else
       return resp.send 200, datasets
 
-# :todo: should :user be part of the dataset URL?
-app.get '/api/:user/datasets/:id/?', checkThisIsMyDataHub, (req, resp) ->
+getDataset = (req, resp) ->
   console.log "GET /api/#{req.params.user}/datasets/#{req.params.id}"
   Dataset.findOneById req.params.id, req.user.effective.shortName, (err, dataset) ->
     if err?

          Dataset.findOneById dataset.box, req.user.effective.shortName, (err, dataset) ->
            console.warn err if err?
            resp.send 200, dataset
            addView user, dataset,
              tool: 'datatables-view-tool'
              displayName: 'View in a table' # TODO: use tool object
            , (err, view) ->
              if err?
                console.warn "Error creating DT view: #{err}"

app.post '/api/:user/datasets/:dataset/views/?', checkThisIsMyDataHub, (req, resp) ->
  user = req.user.effective
  Dataset.findOneById req.params.dataset, (err, dataset) ->
    # Add view to dataset and save
    body = req.body
    addView user, dataset,
      tool: body.tool
      displayName: body.displayName
    , (err, view) ->

    else
      return resp.json 201, user

postStatus = (req, resp) ->
  console.log "POST /api/status/ from ident #{req.ident}"
  Dataset.findOneById req.ident, (err, dataset) ->
    if err?
