Add timeout argument to Api.
Merge pull request #112 from brodul/timeout

Add timeout argument to Api.