completed the work of the MarketController class