Small improvements in API.