Improve $.ajax method signature unit test and placement