Fix file deletion

Return 500 in case of exception

Change-Id: Ief08e3012316dc110eaf6fc85d4421683372bc61