Added duration() method to rest