Handle reconnecting
Move log http server to stdin script. Fix API