client for sending to EC2. Please see comments inside.