Added register method to obtain clientId