refactored AddEvent method

created additional methods addRelation, checkDuplicate