Using Preferences for accessing the Rest Api.