code: func (hs *HTTPServer) RemoveTeamMember(c *m.ReqContext) Response {
  	orgId := c.OrgId
  	teamId := c.ParamsInt64(":teamId")
  	userId := c.ParamsInt64(":userId")
  
  	if err := teamguardian.CanAdmin(hs.Bus, orgId, teamId, c.SignedInUser); err != nil {
  		return Error(403, "Not allowed to remove team member", err)
  	}
  
  	protectLastAdmin := false
  	if c.OrgRole != m.ROLE_ADMIN {
  		protectLastAdmin = true
  	}
  
  	if err := hs.Bus.Dispatch(&m.RemoveTeamMemberCommand{OrgId: orgId, TeamId: teamId, UserId: userId, ProtectLastAdmin: protectLastAdmin}); err != nil {
  		if err == m.ErrTeamNotFound {
  			return Error(404, "Team not found", nil)
  		}
  
  		if err == m.ErrTeamMemberNotFound {
  			return Error(404, "Team member not found", nil)
  		}
  
  		return Error(500, "Failed to remove Member from Team", err)
  	}
  	return Success("Team Member removed")
  }
docs: // DELETE /api/teams/:teamId/members/:userId