Add base logic for API.