code: func (api OrganizationsAPI) GetInvitations(w http.ResponseWriter, r *http.Request) {
  	globalid := mux.Vars(r)["globalid"]
  	status := invitations.ParseInvitationType(r.FormValue("status"))
  
  	invitationMgr := invitations.NewInvitationManager(r)
  	invites, err := invitationMgr.FilterByOrganization(globalid, status)
  
  	if handleServerError(w, "filtering invitations by organization", err) {
  		return
  	}
  
  	usrMgr := user.NewManager(r)
  	valMgr := validationdb.NewManager(r)
  	views := make([]*invitations.JoinOrganizationInvitationView, len(invites))
  	for i, invite := range invites {
  		// todo: query in loop -> will be slow for lots of invites
  		view, err := invite.ConvertToView(usrMgr, valMgr)
  		if handleServerError(w, "converting invite to view", err) {
  			return
  		}
  		views[i] = view
  	}
  
  	w.Header().Set("Content-Type", "application/json")
  	json.NewEncoder(w).Encode(views)
  }
docs: // GetInvitations is the handler for GET /organizations/{globalid}/invitations
  // Get the list of pending invitations for users to join this organization.