REST API fix, stage 1