Updated template to new API