Fixed api.test.php so it won't break in Travis

* removed extra call to tearDown() because this was unnecessary and was causing the Travis error
* not now removing all directories and files from the api storage folder. The dummy modules json files are now kept.
* added some comments
* converted tabs to spaces