Fixed bug with REST API