add template/json func to app layer