Added duration() to Rest.java