I recall some functionality in a PHP framework I was using that allowed you to make API calls on the server side through use of a class or function. It was something like
$user = $api->GET('/accounts/the_user');
which would process the API call without actually making a separate HTTP request. Would this accomplish it?