added tests, for newapi branch only, close closes #22