Fixed bug in API.