generisized the data client and added a stop to the background thread