Add logic to fetch saved login state from server.

Also, improve the controller's state logic (loading/login state and message).