code: func CreateContract(w http.ResponseWriter, r *http.Request, includedparty contractdb.Party) {
  	contract := &contractdb.Contract{}
  	if err := json.NewDecoder(r.Body).Decode(contract); err != nil {
  		http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
  		return
  	}
  	if contract.ContractId == "" {
  		log.Debug("ContractId can not be empty")
  		http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
  		return
  	}
  	hasuser := false
  	for _, party := range contract.Parties {
  		if party.Type == includedparty.Type && party.Name == includedparty.Name {
  			hasuser = true
  		}
  	}
  	if !hasuser {
  		contract.Parties = append(contract.Parties, includedparty)
  	}
  	contractMngr := contractdb.NewManager(r)
  	err := contractMngr.Save(contract)
  	if err != nil {
  		log.Error("ERROR while saving contracts :\n", err)
  		http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
  		return
  	}
  	w.WriteHeader(http.StatusCreated)
  	json.NewEncoder(w).Encode(&contract)
  }
docs: //CreateContract will save contract