Added duration() method to Rest.