Added functionality to register new users.