error loging,server loaded from file,data req fix

added initial error logging
server that is supposed to be contacted is loaded from 'server' file
data is being requested only when there is api key supplied