Fixing PHP warning.
Cleaning files.

Adding api_get_path(WEB_CODE_PATH), updating docs, format code.
Should fix empty list bug see #6823.