connection and socket timeouts

Add connection and receive timeout for all api calls.