code: func validateDevice(d string, w http.ResponseWriter) error {
  	if _, err := dbClient.GetDeviceByName(d); err != nil {
  		if err == db.ErrNotFound {
  			http.Error(w, "Device was not found", http.StatusNotFound)
  		} else {
  			http.Error(w, err.Error(), http.StatusServiceUnavailable)
  		}
  		return err
  	}
  
  	return nil
  }
docs: // Validate that the device exists