change the service_tasks from curl to pure-pyhton code