#521|Sandeep|  Fixing bug , using right api to check if template exists for a program.