Adding CORS to apiv1

Adding CORS to apiv1 for javascript call support.