Server side code for data security