adding invite validations and refactoring invites