Added ability to define basePath in options