api updates, properly handles bad method and endpoint errors