Added requireArguments function for API

Ensures arguments exist in $arguments for public/API-style functions,
which will be useful for standardizing complaints. Currently only used
in api.php.