bugfix: detect empty objects and return a 404 not found

instead of hanging until a timeout occurs