refactored show ap list in main
exit cleanup for ap mode