remove reflection declarations, check for no record found and 404 if so, remove trace