(How was it correct to prostrate before Adam by angels and he's just a creation)
Prostration, is not allowed and not correct except for God may praise be to Him, because it is a worshipping and it won't be except for God, otherwise it would be a disbelieve or paganism and such thing is impossible to be done by the Angels that are protected against doing any sins. The real matter is that this prostration is done by a commandment from God and so it is a prostration for God as it was mentioned by them (PUT) ["them" meaning the prophet and his Household PUT] about this matter. From Al-Sâdiq (PUH): whoever prostrated by a command from God, then it is a prostration for God and obeying his order, and if it wasn't the commandment by His Highness he wouldn't prostrate. And this is what had been told also by Al-Imam 'Ali ben Muhammad Al-Hâdi (PUH) when he said: prostration before Adam by Angels was not for Adam but for obeying God and endearment for Adam.
After all, prostration before Adam was but as an endearment for him and in real it was worshipping for God because it was done by His command. Al-Mohaddeth Al-Qommi in "Safeenat Al-Bihâr" in Al-Moqâm[apparently seems it is a book name done by a person called Al-Mohaddeth Al-Qommi] did say: you should know that Muslims all agreed that prostrating was not for the purpose of worshipping, but as an endearment for Adam (PUH) and in deep it was a worshipping for God since it was by His command and this is chosen by most of the interpreters, and God's sayings "then fall down before him prostrate"(Sad: 72) and about Joseph (PUH) "they fell down before him prostrate" (Yusuf: 100) both have the same interpretation, and the prostration was for God only and for obeying His commandment and was for the endearment of Adam and Joseph (PUT), like prostrating for God for the occurence of grace or the disappearing of a grace. It is told from Prince of Believers (PUH) that he said that the first spot on earth that God was worshipped on is that on Kufa[a city in Iraq that had been made a capital during the rule of 'Ali ben Abi Tâlib PUH] and that was when God ordered Angels to prostrate before Adam (PUH) and so they did that on the surface of Kufa.