Rework rest api