Old API as well as new one, added test to cover both cases.