[Front-end] Refactored registration code to use defered promises.