Implemented duration method in Rest.java