generify api a bit