Add argument check for API

Proposal Summary

Add argument check for API functions

Detailed Feature Description

If we found invalid arguments, throws exception there.