Heartbeat API implementation and template system