added timeout to APICall and tidied finction parenthesis