If the REST connector produces an empty file without any contents, you can use the fileread() operation to check if the file contains content or not with the following script. You can then branch them appropriately using a branch connector based on the header:
<arc:set attr="file.file" value="[filepath]" />
<arc:call op="fileRead" in="file" out="result" >
<arc:if exp="[result.file:data | equals('')]">
<arc:set attr="output.header:Empty" value="Yes" />
<arc:else>
<arc:set attr="output.header:Empty" value="No" />
</arc:else>
</arc:if>
</arc:call>
<arc:set attr="output.FilePath" value="[FilePath]" />
<arc:push item="output" />
Additionally, you can write the script based on file size as well.