added templating to jquery ajax