Merge/json api related commits

cc @georgestephanis 
Would this be simpler to just cast the result of the filter as a boolean?