 Firebase = require('firebase')
 table = new Firebase('https://thetable.firebaseio.com/')
 
-mytoken = require("./private-token")
-
-FirebaseTokenGenerator = require("firebase-token-generator")
-tokenGenerator = new FirebaseTokenGenerator(mytoken)
-token = tokenGenerator.createToken({name: "table-api"}, {admin: true})
-
-table.auth(token, (error) ->
-  if(error)
-    console.log("failed to auth", error)
-   else
-    console.log("authed.")
-)
+auth = (req) ->
+  mytoken = req.params.token
+  if mytoken == "" or mytoken is null or mytoken is undefined
+   return false
+  FirebaseTokenGenerator = require("firebase-token-generator")
+  tokenGenerator = new FirebaseTokenGenerator(mytoken)
+  token = tokenGenerator.createToken({name: "table-api"})
+  table.auth(token, (error) ->
+    if(error)
+      console.log("failed to auth", error)
+    else
+      console.log("authed.")
+  )
 
 app = express()
-app.get "/match", (req, res) ->
+app.get "/:token/match", (req, res) ->
+  auth req
   current = table.child('current_games')
   current.once('value', (nameSnapshot) ->
     game = nameSnapshot.val()

    ]
  )
  return
app.get "/match/away", (req, res) ->
  away = table.child('current_games')
  away.once('value', (nameSnapshot) ->
    game = nameSnapshot.val()

  )
  return

app.get "/:token/match/home/add", (req, res) ->
  auth req
  add = table.child('current_games')
  add.once('value', (nameSnapshot) ->
    game = nameSnapshot.val()
