add crud code to template