Initial implementation of capturing stdout in the API.
Trying unsuccessfully to log stderr along with stdout.