added closing each connection to bloomfire api properly

the API class did not close the connection before.
This might be the source of the Bloomfire-can't-connect error, as it vanishes after each rebuild aka server restart. Its not a guaranteed solution, but closing connections is always a good thing.