Return proper response when using stream output

The 'code', and more importantly, the 'url' properties are not included in the response which I fixed with this patch.