Internal api cleanup

Resolves #320