Adjusted err logging and added validation/schema