Switch default query to 'select 1'

Fixes gh-555
Return actual status code not 200 to machine client

Machine clients are much more fussy than browsers and we
should take care to preserve the HTTP status for them.

Fixes gh-596