[fix] close db when you close server
[test] add test for live-stream