Introduce rest api

you should change the first parameter name to $template