refactoring circular linked list api and test case