Investigations on the crystallization and characterization of biominerals calcium and magnesium phosphates