Added API class with methods to login, logout, and retrieve user ID and handle.