updated code and tests to always output all json keys, even when they constitute a null or zero-length resource