Added functionality for login / registering.