real purpose of creation

What is the real purpose of creation? Allah swt answers this question on different ocassions in Holy Quran.I am quoting just two instances from Quran :

1 "Did you think that We had created you in play (without any purpose), and that you would not be brought back to Us?" (Al-Mu'minun 23:115)

2 And I (Allâh) created not the jinns and humans except they should worship Me (Alone). (Adh-Dhariyat 51:56).