API Phase 2

solution to phase 2
Update to API Project 1 Phase 2

fixed for nil value