Added sweets cache support
update for unified cache system. Added error handling on template rendering