Handle WHERE parse errors for JSON and other

TODO: HTML needs to show appropriate error message
Added validation for parameters to slice resource

* Basic for now, but easier to build on for later
Add functions to parsing

WIP: functions are not yet able to be handled by Mongo, nor are they checked for validity
Small bugfix