{% set datasets = datasets or [] %}
{% set truncate = truncate or 140 %}
{% set truncate_title = truncate_title or 80 %}

{% if datasets %}
<h3>{{ _('Sample APIs') }}</h3>
<div class="row horizontal-dataset-list">
{% for dataset in datasets %}
{% set title = h.get_translated(dataset, 'title') or dataset.name %}
{% set organization_title = h.get_translated(dataset.organization, 'title') or dataset.organization.name %}
{% set notes = h.markdown_extract(h.get_translated(dataset, 'notes'), extract_length=truncate) %}
<div class="col-md-4">
  <div class="horizontal-dataset-item">
    <div class="border-wrapper">
      <h4 class="organization-title">{{ organization_title }}</h4>
      <a href="{{ h.url_for(controller='package', action='read', id=dataset.name) }}"><h5 class="dataset-title">{{ title }}</h5></a>
      <p class="dataset-description">{{ notes }}</p>
    </div>
  </div>
</div>
{% endfor %}
</div>
<div class="view-all-link">
  <i class="fa fa-chevron-right"></i><a href="">{{ _('Browse APIs') }}</a>
</div>
{% endif %}

{% set datasets = datasets or [] %}
{% set truncate = truncate or 140 %}
{% set truncate_title = truncate_title or 80 %}

{% if datasets %}
<h3>{{ _('Sample APIs') }}</h3>
<div class="row horizontal-dataset-list">
{% for dataset in datasets %}
    {% set title = h.get_translated(dataset, 'title') or dataset.name %}
    {% set organization_title = "" %}
    {% if dataset.organization %}
        {% set organization_title = h.get_translated(dataset.organization, 'title') or dataset.organization.name %}
    {% endif %}
    {% set notes = h.markdown_extract(h.get_translated(dataset, 'notes'), extract_length=truncate) %}
<div class="col-md-4">
  <div class="horizontal-dataset-item">
    <div class="border-wrapper">
      <h4 class="organization-title">{{ organization_title }}</h4>
      <a href="{{ h.url_for(controller='package', action='read', id=dataset.name) }}"><h5 class="dataset-title">{{ title }}</h5></a>
      <p class="dataset-description">{{ notes }}</p>
    </div>
  </div>
</div>
{% endfor %}
</div>
<div class="view-all-link">
  <i class="fa fa-chevron-right"></i><a href="">{{ _('Browse APIs') }}</a>
</div>
{% endif %}

Add handler if organization is missing for some reason
Add handler if organization is missing for some reason
