added JSON response handlers , sorting and filtering