N-tier application architecture