The REST sensor raises an error and returns an empty reply if no data is returned from the GET. This then causes an error when evaluating a template sensor.
I currently have this value_template which I think need to change to use state_attr() which I think should avoid an exception being raised.
I gave this a shot, but unfortunately it does not have the desired effect. If the restful api call fails, sensors get no data and report erroneously. You can see the effect here: