{% for functionGroup in site.api %}

    <div class="row">

        <header class="span12">
            <h2>{{ functionGroup.title }}</h2>
        </header>

            {% for fn in functionGroup.functions %}
            {% if filter == nill or filter == fn.category %}
                <div class="row span6 api-method">
                    <header>
                        <h2><a href="/api/{{ fn.title }}">{{ fn.title }}</a></h2>
                        {% include api_tags_category.html %}
                    </header>
                    <p class="api-description">
                        {{ fn.description | truncatewords: 100 }} 
                    </p>
                </div>
            {% endif %}
            {% endfor %}
    </div>

{% endfor %}
{% for functionGroup in site.api %}
{% assign render = false %}
{% for fn in functionGroup.functions %}
    {% if filter == nill or filter == fn.category %}{% assign render = true %}{% endif %}
{% endfor %}
{% if render %}
    <div class="row">

        <header class="span12">
            <h2>{{ functionGroup.title }}</h2>
        </header>

            {% for fn in functionGroup.functions %}
            {% if filter == nill or filter == fn.category %}
                <div class="row span6 api-method">
                    <header>
                        <h2><a href="/api/{{ fn.title }}">{{ fn.title }}</a></h2>
                        {% include api_tags_category.html %}
                    </header>
                    <p class="api-description">
                        {{ fn.description | truncatewords: 100 }} 
                    </p>
                </div>
            {% endif %}
            {% endfor %}
    </div>
{% endif %}
{% endfor %}
Stop rendering headers of api listing pages that have no methods
Stop rendering headers of api listing pages that have no methods
