Implemented thread synchronization when making http request to api. without the synchronization, it was possible for the server ot attempt to insert multiple tuples with the same UPC into the UPC table. This causes a mysql error as that field is UNIQUE.