changed the way APIProxy instantiated