Errorhandling improved and removed nullpointer

1. I changed the errorhandling to include the acces denied state. That error can occur when the api-key is entered wrong. Now there is no error visible and the gui only shows "null" as reason.

2. When changes in the settings are done, the app crashes with nullpointer on exiting the preferences.