move api to namespace, move test code from controller to integration test