[#44396693]  Add support for count call in custom code api

Get the number of objects that match specific conditions.

Requires corresponding changes in starscream.