Improved get_field_groups function and removed options API code from api.php

Signed-off-by: Elliot Condon <e@elliotcondon.com>