Add test for api proxy middleware