Improve error handling & fix null pointer exceptions for login and graph...

when you PR this to develop branch you will see I have added a `checkActiveSession ` method you can re-use here.