added miguels idea for api