Calculating duration and pretty duration on server instead