add close db method, and fix null json