My recommendation is not to create an empty file.  Simply return an empty object when there's no content.