Speed up permission check when listing items

Questionnaire listing was very slow (several seconds) when the entire
world was loaded. This was due to poor SQL query making unnecessary
LEFT JOIN. We replaced everything with a subquery to address the current
issue and prevent future similar cases.
Document the REST API
Countries were not searchable