refactored the Invites controller and pushed all the logic down into the Invite model, now cleaner and reads better