add apurl checking and logging