Fix api to get heartbeat and contract count.