Moved API to use sinon