Added login api + tests.