Updated TimeInterval on the validation checking: updated the logic of
isValidTimeInterval when startTime, endTime and duration are given. The
granularity still needs to update.