API - Basic API calls

Always think how you would possibly write a test case whenever you write a logic for your functions. if $log is null or empty you will raise php error when trying to get a property "ip_address"