Avoid PHP error in rest controller

Avoid PHP error if key does not exist.