Initial HTTP API functionality for client.php
Fix warnings during API requests