updated tests and test for integrated API