Separated the template into two angularjs views
Fixed login handling.