Some API refactoring. I may have missed some.

Signed-off-by: William Lebel <lebelwilliam@gmail.com>