Fix 500 status code on DELETE request

Closes bug: #1318620

Change-Id: I0a5876111dfbe8f1284f28b3b9bf914779c1f560
Merge "Fix 500 status code on DELETE request"