added server side authentication and linked to user in db