code: func getReadingByIdHandler(w http.ResponseWriter, r *http.Request) {
  	defer r.Body.Close()
  
  	vars := mux.Vars(r)
  	id := vars["id"]
  
  	switch r.Method {
  	case http.MethodGet:
  		reading, err := getReadingById(id)
  		if err != nil {
  			switch err := err.(type) {
  			case *errors.ErrDbNotFound:
  				http.Error(w, err.Error(), http.StatusNotFound)
  				return
  			default: //return an error on everything else.
  				http.Error(w, err.Error(), http.StatusInternalServerError)
  				return
  			}
  		}
  
  		encode(reading, w)
  	}
  }
docs: // Get a reading by id
  // HTTP 404 not found if the reading can't be found by the ID
  // api/v1/reading/{id}