Fixed typo in specs.
Updated the specs to correspond to change in parameters order.
Fixed type spec for new API.

Changes include moving types declaration to according modules.