Adding logic to handle the requests as Thread.