Added support for asyncronous response and multithreading