CDAP-469 Endpoint to list all services

You can simplify it a bit as:

```java
Collection<? extends ProgramSpecification> programSpecs;
switch (type) {
  case FLOW:
    programSpecs = appSpec.getFlows().values();
  break;
  case PROCEDURE:
    programSpecs = appSpec.getProcedures().values();
  break;
  ...
  default:
    throw new Exception("Unknown program type: " + type);
}
for (ProgramSpecification programSpec : programSpecs) {
  result.add(makeProgramRecord(appSpec.getName(), programSpec, type));
}
```