added threaded processing of API calls