change a bit how peers are detected and cleanup api.