added api with tests