Added an api, and a front-end hook to update time every second.