Update API to use stricter type checks.

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