Q:

Questions regarding Monero wallet keys file, RPC transfer method, fee estimate and account index

I have following questions regarding Monero wallets.
Using the Monero GUI and CLI wallet, I have created a wallet which generates three files in my file storage. One is a text file, which has the address of my wallet, and another file with .keys extention.
My questions:

What format are the values in the .keys file? I.e. Hex/Base58 or something else?
If I create a new, second wallet, does it have one account at index 0 and default address at 0 index too? 
As per the API documentation, query_key will return either the private view key or mnemonic seed. If I want to execute the transfer method, why don't I need the private spend key in the parameters object? Or do I have to do this process using the sign transaction method separately and then call transfer? 
How do I estimate fees before sending a transaction?
If I move forward with the concept I've explained in Q2, then should I make a transfer and pass 0 as account_index? Which wallet will be choosen? 

A:

The keys file is binary data. It's actually a json string that is encrypted with your wallet password. 
Whenever you create a new wallet, it always starts with a single account (account index 0), with a single main address (subaddress index 0).
The wallet RPC only operates with one wallet at a time, so once you have opened a wallet, the keys are loaded and you do not need to specify any key to perform a transfer. query_key is used for other purposes, not transfers. 
Call transfer with do_not_relay:true and get_tx_metadata:true. This will respond with the fee in the result object and the tx data you can then use with the relay_tx method.
The wallet that gets used is the one you started the monero-wallet-rpc with or the wallet 
file you opened with open_wallet. Specifying account_index:0 when doing a transfer, instructs the transfer to send from the first (main) account of the currently opened wallet. 

