register api test added
code refactoring