reworking RestAPI