Implement updated API

Signed-off-by: Michael Barton <mail@michaelbarton.me.uk>
Merge branch 'updated-api'