code: func hapiConversationsNeedTraining(w http.ResponseWriter, r *http.Request) {
  	if os.Getenv("ABOT_ENV") != "test" {
  		if !isAdmin(w, r) {
  			return
  		}
  		if !isLoggedIn(w, r) {
  			return
  		}
  	}
  	msgs := []struct {
  		Sentence   string
  		FlexID     *string
  		CreatedAt  time.Time
  		UserID     uint64
  		FlexIDType *int
  	}{}
  	q := `SELECT * FROM (
  		SELECT DISTINCT ON (flexid)
  			userid, flexid, flexidtype, sentence, createdat
  		FROM messages
  		WHERE needstraining=TRUE AND trained=FALSE AND abotsent=FALSE AND sentence<>''
  	) t ORDER BY createdat DESC`
  	err := db.Select(&msgs, q)
  	if err == sql.ErrNoRows {
  		w.WriteHeader(http.StatusOK)
  	}
  	if err != nil {
  		writeErrorInternal(w, err)
  		return
  	}
  	byt, err := json.Marshal(msgs)
  	if err != nil {
  		writeErrorInternal(w, err)
  		return
  	}
  	_, err = w.Write(byt)
  	if err != nil {
  		log.Info("failed to write response.", err)
  	}
  }
docs: // hapiConversationsNeedTraining returns a list of all sentences that require a
  // human response.