Update rest.php

Avoid PHP error if key does not exist
Merge pull request #1438 from Art4/patch-1

Avoid PHP error in rest controller