Issue #1920602 Use entity modules API to get entity type and bundle
Issue #1920602 Fixing the errors when viewing and entity and when trying to view an entity under the wrong bundle