code: func encode(i interface{}, w http.ResponseWriter) {
  	w.Header().Add("Content-Type", "application/json")
  
  	enc := json.NewEncoder(w)
  	err := enc.Encode(i)
  	// Problems encoding
  	if err != nil {
  		LoggingClient.Error("Error encoding the data: " + err.Error())
  		http.Error(w, err.Error(), http.StatusInternalServerError)
  		return
  	}
  }
docs: // Helper function for encoding things for returning from REST calls