           Dataset.findOneById dataset.box, req.user.effective.shortName, (err, dataset) ->
             console.warn err if err?
             resp.send 200, dataset
-            addView user, 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) ->
+# Add view to dataset and save
+addView = (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,
+    _addView user, dataset,
       tool: body.tool
       displayName: body.displayName
     , (err, view) ->

        else
          resp.send 200, success: 'ok'

app.get '/api/:user/sshkeys/?', (req, resp) ->
  User.findByShortName req.user.effective.shortName, (err, user) ->
    resp.send 200, user.sshKeys

# Catch all other routes, send to client app
app.get '*', renderClientApp

# Define Port
port = process.env.CU_PORT or 3001

if existsSync(port)

        getSessionUser u
      return resp.send 200, result

addSSHKey = (req, resp) ->
  User.findByShortName req.user.effective.shortName, (err, user) ->
    if not req.body.key?
      return resp.send 400, error: 'Specify key'
