added heartbeat, minor server fixes