Synthesis and characterization of magnesium doped calcium phosphate for bone implant application