Changed login logic to use APICall class