Cleanup APIModule, WebModule by moving common functions to UserResponse.php, so it can be tested