Adjusted object creation to take a hash and return error if required args are missing. Added simple rescue that tried the other URL if the first one fails.