If you are editing the file in the modules directory then that is the problem. A module gets pulled in and kept by the server until restart unless you add a parameter to the local_import()
api = local_import('api', True) where the True says perform a module reload
on each request.

