new api structur and tests