implemented head -n REST API