add json return types and logging