Respond with html or json as requested
Remove assumption that output will always be populated.
Be explicit about encoding on read to get a string instead of a Buffer.
Merge branch 'jason'