api ip
better error handling