Updated delete functionality to return an error during failure (update the httpstatus returned to a proper value)