added code to generate random id, take photo and send to server