Fixed issue #4

Added duration method in Rest class