fixing tests and further api cleanup