code: func (api CompaniesAPI) Post(w http.ResponseWriter, r *http.Request) {
  
  	var company companydb.Company
  
  	if err := json.NewDecoder(r.Body).Decode(&company); err != nil {
  		log.Debug("Error decoding the company:", err)
  		http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
  		return
  	}
  
  	if !company.IsValid() {
  		log.Debug("Invalid organization")
  		http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
  		return
  	}
  
  	companyMgr := companydb.NewCompanyManager(r)
  	err := companyMgr.Create(&company)
  	if err != nil && err != db.ErrDuplicate {
  		log.Error("Error saving company:", err.Error())
  		http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
  		return
  	}
  
  	if err == db.ErrDuplicate {
  		log.Debug("Duplicate company:", company)
  		http.Error(w, http.StatusText(http.StatusConflict), http.StatusConflict)
  		return
  	}
  
  	w.Header().Set("Content-Type", "application/json")
  	w.WriteHeader(http.StatusCreated)
  
  	json.NewEncoder(w).Encode(&company)
  }
docs: // Post is handler for POST /companies
  // Register a new company