Fix logging of IP address on API requests to use correct remote address