merged dev and manually resolved conflict in MercuryApi.class.php