fixed rest missing response id and cleaned up api php