Refactoring.

Added `apiCheck` and `apiCheckDecode`.
Added `RestCall` type alias.