removed decode and added optional entityid for create entity