Reorganized the API structure