Return ajax from callback so it can be used outside the function