Integration test for API