cleaning api code and finding user merchants dynamically