adding ability to get connection to elasticsearch and fixing loading from config