Fix mockapi for tests