Essays on market and mechanism design