Changed API to be more consistent with other projects