(e) To undertake commitments to make mortgage loans; to sell mortgages at public or private sale, with or without bidding; to foreclose on any mortgage or commence any action to protect or enforce any right conferred upon the municipality by law, mortgage, contract or other agreement, and to bid for and purchase property which was the subject of such mortgage, at any foreclosure or at any other sa