Added login functionality, needs testing