Reworked API implementation as object with interface, instead of
module level methods.