Added function inviteGroup to ApiController