CodeMirror: Apex mode @RestResource(urlMapping = '/accounts') global with sharing class AccountsController { private static SoqlService soqlService = new SoqlService(); @HttpGet global static void getActiveAccountIds() { RestContext.response.responseBody = Blob.valueOf(soqlService.getAllActiveAccountIds()); RestContext.response.statusCode = 200; } } public class SoqlService { public SoqlService() {} public List getAllActiveAccountIds() { List accounts = [ SELECT Id FROM Account WHERE IsDeleted = FALSE]; List accountIds = new List(); for (Account account : accounts) { accountIds.add(account.Id); } return accountIds; } } @isTest public class SoqlServiceTests { private static SoqlService service = new SoqlService(); @isTest static void testGetAllActiveAccountIds() { test.startTest(); Account active = new Account(); insert active; Account inactive = new Account(); insert inactive; delete inactive; List output = service.getAllActiveAccountIds(); System.assert(output.contains(active.Id)); System.assert(!output.contains(inactive.Id)); test.stopTest(); } } A mode for Apex MIME types defined: text/x-apex