Added error check for return from API manager

Error check from API manager
Minimal logging to php_error.log
added check to parameters call for empty stuff