added secure key
fixed VCR issue with codeclimate
remove duplicated code
full remove duplicate code from api_connection