More informative API responses: Issue 514

Include more informative error responses.