API for anagrams and palindromes