made seperate methods for ajax calls