Restructure the API