Allow for custom headers in __send_request

Signed-off-by: Amr Ali <amr@databracket.com>
Fix upload_key POST request format to JSON

Signed-off-by: Amr Ali <amr@databracket.com>