Added login and logout to API