Restful service for n-grams