Fix bad request entity in rest methods