Updated Server Code after Review