Validation with promises (q) added to register method.