Investigations on the crystallization and characterization of biominerals: Calcium and magnesium phosphates