Add functions to call "register" API

I've added functions to call "register" API and their test cases.
Could you include this into master branch?