Added midde and end trait sessions to the iOS app.

Also added some addition error checking.