Improve debug api + add test cases