The 204 is apparently being treated as "no list" or null, rather than as an empty list. I'd say that's a reasonable behaviour. You're probably going to need to either check for a 204 and special-case it or change the API to return 200 OK with no elements. I would urge you to do the latter. I'm not sure that you're using 204 the way it's intended.
From RFC 2616,
The server has fulfilled the request but does not need to return an entity-body
In your case, the server does need to return an entity-body, it just happens that the entity is an empty collection. Typically 204 is used for POSTs or DELETEs.