make API constructors a bit smart