Add unit test cases for internal APIs and missed APIs