Use 400 error code for missing parameters

Includes Andy's fix in #67.