Created method for getting instances by type id