Check for the mainApiFile in directories in GOPATH

The $GOPATH could represent severals directories. This code first check
in which directory the mainApiFile is located