Change behaviour of template management and clean up curl return code

We can use PUT instead of DELETE+PUT/POST
Makes code easier to read and IMHO more robust

Also use `curl -f` to catch return codes matching HTTP codes

ensure => present: simply PUT the template
ensure => absent:  simply DELETE the template