update endpoint, fix maths