updating the server code
updating the server script
adding code for client
server: coding style fixes
server: add status key to JSON output
server: Remove extra else statement
server: fix for get_ipaddress function

If the server finds some IP address in the query string and it's an invalid IP address, it returns an error message.
Earlier it was trying to guess the IP address of the client if the query string contained an invalid IP address.
server: fix get_client_ipaddress()

Fix memory leak and remove redundant lines.
server: change GEOIP_DATABASE_PATH env variable

to be a path to a directory and change the error message accordingly