Missing blank line
Fix handling of invalid parameter
Simplify error path
Simplify response parsing