Update to latest version of API and use logging instead of print statements.
Fixed session save and added more logging