toggle for restful api