The Civicrm API seems to always return 200 (aka 'Success') even when there is an error (in the parameters of the request, or otherwise). To indicate an error, it instead sets the 'is_error' flag to '1' in the response.
This is fine, but is there a reason why it wouldn't set a more appropriate error code depending on the case (i.e. a 400 'Bad Request' code for malformed requests)? For example, when using a javascript http client and making an ajax API request it would allow use of default error handlers (function to call on success, function to call on fail).