Changed the way requests are handled to be able to test the outgoing requests.