RasoolAllah in his fatal illness said: 'Allah cursed the Jews and the christian because they took the graves of their prophets as places of worship (mosques)'- [Bokhari, 2:414]. Making the graves of saints as mosques is therefore forbidden. Visiting graves is permitted only for the purpose of remembering the Hereafter. Hence supplicating to Allah at the graves or shrines making the dead as intermediary between self and Allah is a sin and amounts to shirk.
Please recite to understand Surah Al-Bakarah, ayah 186; Surah Al-Momin, ayah 60; and Surah Al-Araf, ayah 55. Have faith and put your trust in Allah, Allah is closer to you than your jugular vein. He hears when you call Him in the depth of your heart humbly, and would accept your supplication in a way which is best for you.