Api merged into api

Bringing in api the merge Padraig has done