Fixed a bug in the restful api