CLOUDSTACK-241: Remove API sync. Merge changes from 4.1 branch. Converted tabs to spaces.