I like the convention:
- 404 if resource requested by id
- 200 with empty list of results if it was a 'search' type request with params (not referring directly to an id)
- 404 if resource requested by id
- 200 with empty list of results if it was a 'search' type request with params (not referring directly to an id)
- If I query for an identifier which doesn't exist - Server replies 404, this should fall into my error handling as there's a data inconsistency
- If I query say like ?category=automotive&price=1 and I get a 200 containing a json body in which there's an empty list of matches, then my client code can handle 0 matches as well as 1 or 10 with no special handling.