[IM] Add in AS path check and some sanity checks