Remove unnecessary variables and add stub for API testing