Update rest.php

Avoid PHP error if key does not exist