Api changes

See commits.