split code out for safety with some error checks
split code out for safety with some error checks

willmclaren/ensembl-rest,ens-lgil/ensembl-rest,willmclaren/ensembl-rest,willmclaren/ensembl-rest,ens-lgil/ensembl-rest,helensch/ensembl-rest,helensch/ensembl-rest,helensch/ensembl-rest,ens-lgil/ensembl-rest,willmclaren/ensembl-rest,helensch/ensembl-rest,helensch/ensembl-rest,willmclaren/ensembl-rest,ens-lgil/ensembl-rest,ens-lgil/ensembl-rest