api is not necessarily defined yet.

Signed-off-by: Chris Lamb <lamby@debian.org>
Merge pull request #2 from lamby/master

"api" in finally block is not necessarily defined yet