Fix races when resource is deleted while we are working with it

Mostly there is much better response then internal error (500)
to return in such cases.

Change-Id: I68ca8c852ddb5e5885319bde7292289312fec3aa