class EmployeeController {

    @PostMapping("_search")
    @ResponseBody
    public ResponseEntity<?> search(@ModelAttribute @Valid EmployeeCriteria employeeCriteria,
                                    BindingResult modelAttributeBindingResult, @RequestBody @Valid RequestInfoWrapper requestInfoWrapper,
                                    BindingResult requestBodyBindingResult) {
        RequestInfo requestInfo = requestInfoWrapper.getRequestInfo();

        ResponseEntity<?> errorResponseEntity = requestValidator.validateSearchRequest(requestInfo,
                modelAttributeBindingResult, requestBodyBindingResult);

        if (errorResponseEntity != null)
            return errorResponseEntity;

        // Call service
        Map<String, Object> employeeMap = null;
        try {
            employeeMap = employeeService.getPaginatedEmployees(employeeCriteria, requestInfo);
        } catch (Exception exception) {
            log.error("Error while processing request " + employeeCriteria, exception);
            return errorHandler.getResponseEntityForUnexpectedErrors(requestInfo);
        }

        return responseEntityFactory.getSuccessResponse(employeeMap, requestInfo);
    }

}