Added login and token functionality