api/tests: split test_api.py in 2 files and rewrite tests using pytest
using pytest-flask for test_rpc_server.py