added dependancy injection to service on functions, enforce data matching 1 schema
handle {} in on as well as a schema object
fixed example