implemented client authentication and json parsing