Add more strictness checks on the types
Refactor the types again and test API declarations against them