Move check to delete _id to API route on server side