code: func FindContracts(w http.ResponseWriter, r *http.Request, includedparty contractdb.Party) {
  	contractMngr := contractdb.NewManager(r)
  	includeexpired := false
  	if r.URL.Query().Get("includeExpired") == "true" {
  		includeexpired = true
  	}
  	startstr := r.URL.Query().Get("start")
  	start := 0
  	var err error
  	if startstr != "" {
  		start, err = strconv.Atoi(startstr)
  		if err != nil {
  			log.Debug("Could not parse start: ", err)
  			http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
  			return
  		}
  	}
  	maxstr := r.URL.Query().Get("max")
  	max := 50
  	if maxstr != "" {
  		max, err = strconv.Atoi(maxstr)
  		if err != nil {
  			log.Debug("Could not parse max: ", err)
  			http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
  			return
  		}
  	}
  
  	contracts, err := contractMngr.GetByIncludedParty(&includedparty, start, max, includeexpired)
  	if err != nil {
  		log.Error("ERROR while getting contracts :\n", err)
  		http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
  		return
  	}
  	w.Header().Set("Content-type", "application/json")
  	json.NewEncoder(w).Encode(&contracts)
  }
docs: //FindContracts for query