fixed id name in js
added create flag and moved template parser into handler