CODE: Add session logout, error handling, and server option