Signatures of the superfluid to Mott-insulator transition in the excitation spectrum of ultracold atoms