Store end time as duration. add framework for cron job