In this chapter, we'll be building an API module for our content-management system. The development of this module can be broken down into several pieces:
Configuring the module
Extending Yii to "RESTfully" render JSON or XML instead of a view file
Handling data input
Handling user authentication
Handling exceptions and errors
Specifying what data will be returned with each response
Implementing authentication, deauthentication, and basic CRUD actions
The first component of this project will consist of creating and configuring our module so that it integrates with our main application. Since we added the functionality that seamlessly integrates modules into our application in the previous chapter, the only work required for this section will be to clear out our module cache, initialize the module, and add in the necessary routes.