Server-side logic