Removed commented code blocks
logging on exceptions, removed comments
more error handling for invalid credentials