Improve snippet API response

A couple of small annoyances that have been bugging me mildly, until I decided to do something about them:
* return a trailing newline in the response so my bash prompt doesn't get messed up
* return the final URL so I can pass it to curl directly, without wrangling with redirects (curl doesn't follow them by default)