Tests updated and rewritten to work with the new API