Change API calls for compatibility with Elasticsearch >1.0