added a return after curl stuff to avoid execution of json if curl fails