heartbeat api and fixes