Building a REST client with asynchronous calls using PHP and curl