finished login system with new api wrapper