Use __DIR__ instead of dirname(__FILE__) in main_api