Fixed required parameter count for create and update
Added logging for failures due to foreign key constraints