basic ajax and refresh template functions