diff --git a/swh/web/api/templates/apidoc.html b/swh/web/api/templates/apidoc.html
index ed207309..7aaf0a09 100644
--- a/swh/web/api/templates/apidoc.html
+++ b/swh/web/api/templates/apidoc.html
@@ -1,137 +1,139 @@
{% extends "layout.html" %}
{% load api_extras %}
{% block title %}{{ heading }} – Software Heritage API {% endblock %}
{% block content %}
{% if docstring %}
Description
{{ docstring | safe_docstring_display | safe }}
{% endif %}
{% if response_data %}
Request
{{ request.method }} {{ request.build_absolute_uri }}
Response
{% if status_code != 200 %}
Status Code
{{ status_code }}
{% endif %}
{% if headers_data %}
Headers
{% for header_name, header_value in headers_data.items %}
{{ header_name }} {{ header_value | urlize_header_links | safe }}
{% endfor %}
{% endif %}
Body
{{ response_data | highlight_json | urlize_api_links | safe }}
{% endif %}
{% if urls and urls|length > 0 %}
URL |
Allowed Methods |
{% for url in urls %}
{{ url.rule }}
|
{{ url.methods | dictsort:0 | join:', ' }}
|
{% endfor %}
{% endif %}
{% if args and args|length > 0 %}
Arguments
{% for arg in args %}
- {{ arg.name }}: {{ arg.type }}
- {{ arg.doc | safe_docstring_display | safe }}
{% endfor %}
{% endif %}
{% if params and params|length > 0 %}
Parameters
{% for param in params %}
- {{ param.name }}: {{ param.type }}
- {{ param.doc | safe_docstring_display | safe }}
{% endfor %}
{% endif %}
-{% if headers %}
+{% if headers and headers|length > 0 %}
{% endif %}
-{% if return %}
+{% if returns and returns|length > 0 %}
Returns
+ {% for return in returns %}
- {{ return.type }}
- {{ return.doc | safe_docstring_display | safe }}
+ {% endfor %}
{% endif %}
{% if excs and excs|length > 0 %}
Errors
{% for exc in excs %}
- {{ exc.exc }}
- {{ exc.doc | safe_docstring_display | safe }}
{% endfor %}
{% endif %}
-{% if examples %}
+{% if examples and examples|length > 0 %}
Examples
{% for example in examples %}
-
{{ example }}
{% endfor %}
{% endif %}
{% endblock %}