CORE-4135: added a query to get the list of templates for an app