Nowadays wireless networks are becoming important in personal and public communication and growing very rapidly. Similarly, Software Defined Network (SDN) is an emerging approach to overcome challenges of traditional networks. In this paper, a new SDN-based framework is proposed to fine-grained control of 802.11 Wireless LANs. This work describes the benefits of programmable Access Points. The proposed framework is evaluated on a prototype. We show that this architecture allows us to react to application needs, adjust network configuration for a priority application, detect network problems, and improve the user experience of the network. Our architecture relies on the IEEE 802.11 standard, and exploits it to collect information from the stations.