Moved querys to server side