add available_events method to class with state machine