Solved a lot of directive issues, still plenty more to do with the header directive (handling custom headers)