Restructuring the API