added a constructor for hostname and endpoint and switched to ion http framework so we can package the library as jar and deploy to maven