implemented tail -n REST API