Added logic to show/hide loading and retry views.