ipip: refactor ipip.api with explicit types