Added some AJAX and JS functions