Title: Essays in microfoundations of macroeconomics