Fixing unary operator error in $email check.  Also
changing apiuser/apipass to $ variables from JSS.