code: func (h *JSONWriter) WriteCode(w http.ResponseWriter, r *http.Request, code int, e interface{}) {
  	js, err := json.Marshal(e)
  	if err != nil {
  		h.WriteError(w, r, errors.WithStack(err))
  		return
  	}
  
  	if code == 0 {
  		code = http.StatusOK
  	}
  
  	w.Header().Set("Content-Type", "application/json")
  	w.WriteHeader(code)
  	w.Write(js)
  }
docs: // WriteCode writes a response object to the ResponseWriter and sets a response code.