Restful Queries

Hello,
I need to provide restful API access to the data which is in ES. Restful endpoint is nothing more than a query with a few variables. The query could be complicated though.
I don't want to give my clients the entire query, asking them to replace some variables inside of the query, and run it on the ES. I'd prefer just to give them some custom endpoint, and ask them to provide the values for the variables, and run that complicated query myself.
Of course I could build such endpoints myself, and run them on a separate server, but ES is a perfect restful engine already, maybe there is a way to that I need? Maybe there is such plugin?

Please advice,
Eugene

https://www.elastic.co/guide/en/elasticsearch/reference/2.1/search-template.html might do what you want.

Thank you Mark,
I think the template API is good enough. The only things I'm missing, is the way to set current date, something like: {{now}}, or {{now-1month}}, instead of asking clients to provide it as a parameter. But this is not a showstopper.
Eugene