loading div and gapi-core loaded

logic is refactored for gapi-core loaded.