Created API of the serviceThread