fix argument order
add resolveTemplate method for fixing url's in templates.