Refactored API tests

Made the file test_api.py a package with separated modules and classes for each of the API endpoints. The idea is to make it easier to handle and organise the different test cases for the different API functionalities, but I think that it still needs more improvements as it has only been split into several parts.