Note: A complete backup process includes making regular backups, storing them on external media, and testing them regularly to ensure validity.
VBA and API code are created and stored differently and therefore must be backed up differently. You should include any VBA and API code as part of your regular backup procedures.

VBA Code:
VBA code can be stored within the database or in project using the VBA DLL tool.

VBA code stored within the database for which it was written and is unique to each database. Therefore it is included with the regular backup of the main database. VBA code can also be exported from the current/live database and imported into the restored/new database. The exported code can also be kept as a separate, spare backup copy.

Restoring from a backup copy of the database will include only that VBA code which was entered prior to when the backup was made. Any VBA code entered after the backup was made is not included.

VBA projects written using the VBA DLL tool are saved as .VBA files. Each person creating VBA DLL projects can choose which directory to save the project in. To backup VBA DLL projects copy the .VBA files to external media.

API Code:
API code is external to the database and its applications process externally from the program shell. Therefore all files associated with your API code/application must be backed up separately.

Restoring from a backup copy of the database will not affect the API code directly as long as the API code can connect to the correct database after the restore.