Updated Session object to accept api key as contents rather than file name