add get cookie api
handle exception when render template