Rest Api with seperate folder

Hello,
I have an Yii1 application and i want to build Rest API in separate folder within the root directory , lets say the folder name API ,also i want to access this API using HTTPS

any one please can help me about the routing how should be or any thing can help ?