$.ajax method should have success,error,and complete callbacks