bug fixes

fixed stack overflow bug where users could
cause a stack overflow via the api.
fixed a bug where checkbox state would toggle
instead of reflecting the correct state.