fix error printing
allow login to multiple endpoints
defer close to the right place
remove debugging
better error handling
initial pass at oauth