Throw error when invalid client_id is passed in a remote API function

Throw error when invalid client_id is passed in a remote API function. Currently, passing a invalid client_id to an API function results in empty sys_userid and sys_groupid variables being used in the resulting SQL query.