updated code and tests to properly handle 'ip' parameter