Implements mocking in new api