Added API call for defects, modernized requests for session handling