Minor bug fixes in history statistics handling + added environment var
to obtain galaxy api key