Return JSON errors when parameter validation fails.
Merge pull request #664 from matt-thomson/json-errors

Return errors as 'application/json' when parameter validation fails