Adding methods for ajax request to server