moved ajax calls in ApiBundle