register function fixes and api initial implementation