Split Api Module into lovely small functions

Change-Id: I77abd54a50090229c7f3a3daa239bcb185702e46