Refactored use of ApiFactory to Api, ready for LogicFactory