Added duration method to Rest class