S-Boxes, APN Functions and Related Codes