Before registering the API, make the following changes in the web.config file of the API:
Under settings, for the TNS_ADMIN key, add or modify the TNS config file path.
Under appSettings, for the serviceRoot key, add the URL of the host where the API is registered.
(Application Name is required only if website is hosted as application under a website)
Under connectionStrings, Data Source can be pointed to required database for both connection strings, for example, 'dbConnection' and 'SPMatWebApiContext'.