Added data validation for login register etc on the server side