Added template and code for template. Now ajax searchs for words in input field and outputs indexes of messages in table