cleans up data source ajax call
abstracts the two ajax calls into one