Made some fixes to API.