Added error returns to middleman.go