improved api goto method