update functions for JS and add template configuration file