Moved the data source creation logic from api core to rest-app