Update API to use stricter type checks.

Improve type safety by adding dedicated types instead of int.

While this pull request is mainly intended to improve type safety it also facilitates documentation of function arguments.

Updates issue #11