Encode URI (problems with spaces) for getting group membership