Moving API to use IResults where possible and fix in test