AJAX-code for changing status