code: func restCheckForDevice(w http.ResponseWriter, r *http.Request) {
  	vars := mux.Vars(r)
  	token := vars[ID] //referring to this as "token" for now since the source variable is double purposed
  
  	//Check for name first since we're using that meaning by default.
  	dev, err := dbClient.GetDeviceByName(token)
  	if err != nil {
  		if err != db.ErrNotFound {
  			LoggingClient.Error(err.Error())
  			http.Error(w, err.Error(), http.StatusInternalServerError)
  			return
  		} else {
  			LoggingClient.Debug(fmt.Sprintf("device %s %v", token, err))
  		}
  	}
  
  	//If lookup by name failed, see if we were passed the ID
  	if len(dev.Name) == 0 {
  		if dev, err = dbClient.GetDeviceById(token); err != nil {
  			LoggingClient.Error(err.Error())
  			if err == db.ErrNotFound {
  				http.Error(w, err.Error(), http.StatusNotFound)
  			} else if err == db.ErrInvalidObjectId {
  				http.Error(w, err.Error(), http.StatusBadRequest)
  			} else {
  				http.Error(w, err.Error(), http.StatusInternalServerError)
  			}
  			return
  		}
  	}
  
  	w.Header().Set("Content-Type", "application/json")
  	json.NewEncoder(w).Encode(dev)
  }
docs: //Shouldn't need "rest" in any of these methods. Adding it here for consistency right now.