Added duration method in Rest class