Helper method for wrapping the $.ajax call