finalize api, add new tests