made all functions run on server only (sync should do the trick?)