code: func (api UsersAPI) CreateAvatarFromImage(w http.ResponseWriter, r *http.Request) {
  	label := mux.Vars(r)["label"]
  	username := mux.Vars(r)["username"]
  
  	userMgr := user.NewManager(r)
  	u, err := userMgr.GetByName(username)
  	if handleServerError(w, "getting user from db", err) {
  		return
  	}
  
  	if !validateNewAvatar(w, label, u) {
  		return
  	}
  
  	link, errorOccured := saveMultiPartAvatarFile(w, r, userMgr)
  	if errorOccured {
  		// the error responses are already written so just abort
  		return
  	}
  
  	// insert a link to the endpoint that will serve the file
  	avatar := user.Avatar{
  		Label:  label,
  		Source: link,
  	}
  
  	// save the avatar link to the user
  	err = userMgr.SaveAvatar(username, avatar)
  	if handleServerError(w, "saving avatar link", err) {
  		return
  	}
  
  	w.WriteHeader(http.StatusCreated)
  	json.NewEncoder(w).Encode(&avatar)
  }
docs: // CreateAVatarFromImage is the handler for POST /users/{username}/avatar/img/{label}
  // Create a new avatar with the specified label from a provided image file