Properly cull and regenerate access codes for AP mode
Handle empty database in AP mode