Added option to send api key with error tracking