API code fixing couple of issues - Chapter 7