Refactor structure into API & core projects